home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12886 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: hursley.ibm.com!news
  2. From: Max Waterman <dwater@wight.hursley.ibm.com>
  3. Newsgroups: comp.programming,comp.sys.sgi.misc,comp.lang.c
  4. Subject: Re: C pointer question.
  5. Date: Wed, 03 Apr 1996 12:48:43 +0100
  6. Organization: IBM UK Laboratories Ltd.
  7. Message-ID: <3162659B.6201@wight.hursley.ibm.com>
  8. References: <315BFDBB.773C@wight.hursley.ibm.com> <4jlhpl$i3c@hn.ocbbs.gen.nz> <31616BAF.5BAB@datalytics.com>
  9. NNTP-Posting-Host: wight.hursley.ibm.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (X11; I; AIX 2)
  14.  
  15. Rob Stewart wrote:
  16.  
  17. If your reading news:comp.lang.c see news:comp.sys.sgi.misc for full
  18. thread.
  19. I should have posted it here to start with but didn't know it was here,
  20. sorry everyone else.....
  21.  
  22. >[snip]
  23. > Putting them on separate lines is safer
  24. > and leaves room for a comment to the right explaining the
  25. > purpose of the variable.
  26.  
  27. > > I usually don't declare my variables in this style but like ...
  28. > >
  29. > > char* name1;
  30. > > char  name2;
  31. > > char  name3;
  32. > >
  33. > > Less cluttered and easier (i feel) to read ... and that the goal isn't it.
  34. > > [snip]
  35.  
  36. I personally agree - one line per variable - but for some reason the
  37. coding standards at a place I previously worked at forced us to put
  38. variables of the same type on one line. They were for PASCAL rather than
  39. C, but I can't think what the reasons would be for doing this -
  40. especially since coding standards generally favour readability.
  41.  
  42. Ie what are the arguments for :
  43.  
  44. char    name1,
  45.     name2,
  46.     name3;
  47.  
  48. over :
  49.  
  50. char name1;
  51. char name2;
  52. char name3;
  53.  
  54. ?
  55.  
  56. Aren't they identical?
  57.  
  58. Any compiler boffs out there know about this?
  59.  
  60. -- 
  61.     ___                      mailto:max@lton.u-net.com 
  62.   /  /  /  _       /     /  _  __ __   _   __   _
  63.  /  /  / /_/ |/  /  /  / /_/  /  /_   /_/ / / / /_/ /| /
  64. /  /  / /  / /|  /_/_/ /  /  /  /_  /  |  / / / /  / / |/
  65.